home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / standards / ansi / X3T9 / area13 / u9001041.txt < prev    next >
Encoding:
Text File  |  1992-05-12  |  7.5 KB  |  161 lines

  1. This is one of the old Unix-OSD Group Messages that John Gallant sent to me
  2. for posting on the SCSI BBS.  The date reflects when he sent it to me, not
  3. the original message date.  John Lohmeyer
  4. ----------------------------------------------------------------------------
  5. Date: Thu, 4 Jan 90 17:13:23 -0500
  6. From: "John A. Gallant UEG" <jag@decvax.dec.com>
  7. Message-Id: <9001042213.AA25516@abyss.zk3.dec.com>
  8. To: jlohmeye@entec.wichita.ncr.com
  9. Subject: Darryl's Unix OSD document
  10.  
  11. Hello All:
  12.  
  13.     Sorry for the lateness of this mail, but perhaps we can start some
  14. discussion before the CAM meeting.  Remember we did say that we wanted to
  15. start some e-mail discussions, a few months ago :-).
  16.  
  17.     I have a couple of issues and questions to raise about the initialization
  18. parts of Darryl's proposal.  Overall I am in agreement with what Darryl has.
  19.  
  20. [All of Darryl's included text is indicated by a ">" at the beginning of the
  21. line.  Do we all feel this is a good convention to follow ?.  It follows the
  22. usenet posting convention.  JAG].
  23.  
  24.  
  25. >Here is a proposed base for our group's OSD section efforts. 
  26. >
  27. >        --Darryl Richman, Interactive Systems Corp.
  28. >
  29. >       6.5  UNIX_Operating_System
  30. >
  31. >       The UNIX CAM consists of 3 sets of drivers:  1) peripheral
  32. >       drivers that are device class specific, 2) a configuration
  33. >       driver and the XPT, and 3) SIMs that are HBA specific.  Each
  34. >       member of these sets is treated as a UNIX driver and is
  35. >       linked into the kernel.  The XPT and configuration driver
  36. >       are OS vendor specific;  other drivers may come from any
  37. >       source.
  38. >
  39. >       At kernel configuration and link time, a static table of
  40. >       included peripheral drivers and SIMs is created and linked
  41. >       into the configuration driver.
  42.  
  43.     A static table is definitly needed for the configuration/XPT/SIM points.
  44. They are going to need knowledge of how to contact one another in a non link
  45. time manor.  However a problem with the peripheral drivers will occur when
  46. you have BSD based systems vs system V.  It probably will be good to have 
  47. entry/or other points for the drivers within this table.  Perhaps a default
  48. call back or fatal error entry point, or simply a reset/restore point, I'm
  49. not sure just what at this time.
  50.  
  51. >       6.5.1  Initialization
  52. >
  53. >       At system startup, the configuration driver's init function
  54. >       is run from the ioinit array.  .......................
  55.  
  56.     With BSD based there no "ioinit" array, I belive that this is a sys V
  57. concept, where there is one init routine per driver.  In BSD systems there
  58. are the triplet routines probe/attach/slave.  These are called via the
  59. configuration magic higher up in the Kernel.
  60.  
  61. >       .............................  It calls across the CAM
  62. >       interface, through the XPT, to each SIM in turn, allowing
  63. >       them to initialize.  The configuration driver obtains
  64. >       information about each SIM, HBA, and target device detected
  65. >       and maintains a table of these devices.  Note that
  66. >       interrupts are disabled during the ioinit phase.
  67.  
  68.     I would expect them to be turned off during all the setup and init phases.
  69.  
  70. >       After all of the SIMs have initialized and the configuration
  71. >       table has been filled in, the configuration driver invokes
  72. >       the initialization routines for each peripheral driver.
  73. >       This allows them to determine what devices are known and
  74. >       make appropriate memory allocations and resource requests of
  75. >       the XPT.
  76.  
  77.     This is were the I have the biggest problem.  With BSD based systems
  78. the configuration magic sets up a number of data structures that are
  79. used by a lot of the io/fs utilities.  Would this mean that these BSD based
  80. systems would have to minic what the conf code is doing in the
  81. configuration/XPT init handlers ?
  82.  
  83.     I think that what we had originaly discussed back in November(?), is
  84. still valid.  The plan was that the first call to the XPT to initialize
  85. itself from any peripheral driver would kick off the configuration
  86. driver/XPT/SIM sequence.  Once the sequence had finished that initial
  87. call from the peripheral driver would be completed.  Using the ioinit[]
  88. array scheme the first call would come from the configuration driver.
  89. In the BSD/configuraion scheme, the sequence of what peripheral drivers
  90. is called before another is not known, so any peripheral driver could be
  91. called before the configuration driver. 
  92.  
  93.     I know that this is a little complicated but it does remove any
  94. constraints on a predefined initialization sequence.
  95.  
  96. >
  97. >       6.5.2  Accessing_the_XPT
  98. >
  99. >       6.5.2.1  From_the_Peripheral_Driver
  100. >
  101. >       All CAM requests to the XPT are placed through a single
  102. >       function call:  void XPTaction(CCB *).  All returned status
  103. >       information is obtained at the callback point via the CAM
  104. >       and SCSI status fields.
  105. >
  106. >       The XPT also provides functions for obtaining resources for
  107. >       the peripheral driver.  These are:  allocate and free ccb,
  108. >       allocate and free cdb, allocate and free dma.  [Note that
  109. >       these are not specified.  The completed document will have
  110. >       to include definitions of these functions.]
  111. >
  112. >       6.5.2.2  From_the_SIM
  113. >
  114. >       The SIMs obtain requests from the XPT as they are passed
  115. >       across from the peripheral driver, via a routine included in
  116. >       the SIM's configuration information.  The field in the
  117. >       configuration table is declared as
  118. >       void (* SIMaction)(CCB *).  The XPT does not modify ccbs or
  119. >       cdbs.  The XPT must intercept those ccbs which must be 
  120. >       redirected to the configuration driver (i.e., Path Inquiry,
  121. >       Get Device Type, and Set Device Type).
  122.  
  123.     What worries me is that we have spent a lot of work making sure that the
  124. SIMs do not have to worry about what is contained in a CDB.  Now we have the
  125. XPT scanning each CCB for particular commands that need to be routed to 
  126. another driver, even though the configuration driver "works for the XPT".
  127. Unfortunatly I don't have another way to handle this problem.  I do however 
  128. have an possible way to make the interception of CCBs a little simpler.
  129. What about having the commands that are particular to the configuration driver/
  130. XPT be within a range of values or have a particular bit, msb, set to signify
  131. special routing is needed.
  132.  
  133.     This may be too much work considering that we only have about 7 commands, 
  134. but what if the list gets much larger ?  How many cascading if() statements
  135. become too many ? Or how many angels can dance on the head of a pin .. ? Oops
  136. sorry I became carried away :-).
  137.  
  138. >       6.5.3  Callback_on_Completion
  139. >
  140. >       The callback field in the ccb is a structure that is
  141. >       platform specific, but always contains at least a callback
  142. >       function pointer, named cbfcnp, and declared as
  143. >       void (*cbfcnp)(CCB *).  It is allowed for the cbfcnp to
  144. >       contain NULL, in which case no callback operation is
  145. >       performed.
  146.  
  147.    Do we want to look at what the SIM does after the CCB is complete?  I would
  148. expect that it would handle the next CCB on its queue.  But what if its queue
  149. is empty, do we want it to call back to the XPT to allow another SIM to do
  150. something ?  Or would it be better to have each SIM only handle its particular
  151. queue, and have the other SIMs on interrupts handle theirs?  Could we get into
  152. a dead lock condition where everybody is waiting for an event to start off
  153. their queue ?
  154.  
  155. John A. Gallant                        jag@decvax.dec.com
  156. Senior Software Engineer - Ultrix Engineering Group
  157. Digitial Equipment Corp.   (603) 881-2472
  158.  
  159.     "A beautiful theory, killed by a nasty, ugly, little fact."
  160.     Thomas H. Huxly
  161.